package appx.craft.droid.ui;

import java.util.ArrayList;

import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ListView;
import appx.craft.droid.R;
import appx.craft.droid.bean.LikersBean;
import appx.craft.droid.uc.LikersAdapter;
import appx.craft.droid.uc.TabMenuClickListener;
import appx.craft.droid.utils.Log;

public class LikersActivity extends FragmentActivity implements TabMenuClickListener,OnItemClickListener{
	
	private final String TAG = LikersActivity.class.getCanonicalName();
	private ListView listview_likers;
	private ArrayList<LikersBean> mLikersArrayList;
	private LikersAdapter mLikersListAdapter;
	
	LikersBean mBean;
	
	@Override
	protected void onCreate(Bundle saveInstance) {
		super.onCreate(saveInstance);
		setContentView(R.layout.activity_likers);
		Log.d(TAG, "[ onCreate ]");
		
		listview_likers = (ListView)findViewById(R.id.listview_likers);
		listview_likers.setOnItemClickListener(this);
		
		mLikersArrayList = new ArrayList<LikersBean>();
		
		for(int i=0;i<30;i++){
			
			mBean = new LikersBean();
			mBean.setStrProfileID("91293123190239101");
			mBean.setStrFirstName("yummy_ui_"+i);
			mBean.setStrLastName("raiwoa_90_"+i);
			mLikersArrayList.add(mBean);	
		}
		
		mLikersListAdapter = new LikersAdapter(LikersActivity.this);
		listview_likers.setAdapter(mLikersListAdapter);
		
		mLikersListAdapter.addNewLikers(mLikersArrayList);
	}
	
	@Override
	protected void onStart() {
		super.onStart();
		Log.d(TAG, "[ onStart ]");
	}
	
	@Override
	protected void onResume() {
		super.onResume();
		Log.d(TAG, "[ onResume ]");
	}
	
	@Override
	protected void onPause() {
		super.onPause();
		Log.d(TAG, "[ onPause ]");
	}
	
	
	@Override
	protected void onRestart() {
		super.onRestart();
		Log.d(TAG, "[ onRestart ]");
	}
	
	@Override
	protected void onStop() {
		super.onStop();
		Log.d(TAG, "[ onStop ]");
	}

	@Override
	public void onMenuItemClick(int buttonID) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void onItemClick(AdapterView<?> arg0, View arg1, int position, long arg3) {
		startActivity(new Intent(LikersActivity.this,ProfileActivity.class));
	}

}
